//
//  LogoScene.h
//  client
//
//  Created by sunpeng on 8/14/15.
//
//

#ifndef __LOGO_SCENE_H__
#define __LOGO_SCENE_H__

#include "cocos2d.h"
#include "editor-support/cocostudio/CocoStudio.h"


using namespace cocos2d;
class LogoScene : public cocos2d::Layer
{
private:
    cocostudio::timeline::ActionTimeline *logoAction;
    Node *logo;
    bool interrupted;
    time_t beginTime;
    bool withCG;
public:
    // there's no 'id' in cpp, so we recommend returning the class instance pointer
    static cocos2d::Scene* createScene(bool withCG = false);
    
    // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
    virtual bool init();
    
    virtual void onEnterTransitionDidFinish();
    
    virtual void onKeyPressed(EventKeyboard::KeyCode keyCode, Event* event);
    
    // a selector callback
    void menuCloseCallback(Ref* pSender);
    
    void setWithCG(bool withCG);

    void afterLogo();
    void actionEnd();
    bool actionInterrupted(Touch *touch, Event *event);
    
    // implement the "static create()" method manually
    CREATE_FUNC(LogoScene);
};

#endif // __LOGO_SCENE_H__
